<template>
  <div class="blogControl" style="background:#f3f3f4; height: 100%;">
    <!--    头部-->
    <div class="blogSearch" style=" background: white; border-radius: 5px; text-align: left;align-items: center">
      <el-form :inline="true">
        <el-form-item style="margin-bottom: 5px" label="博客名称：">
          <el-input v-model="searchBlogName" placeholder="请输入内容" size="small" />
        </el-form-item>
        <el-form-item style="margin-bottom: 5px">
          <el-button style="background:#1ab394;color: white" size="small" @click="blogSearch">查找</el-button>
          <el-button style="background:#f8ac59;color: white" size="small" @click="resetBlogSearch">重置</el-button>
        </el-form-item>
      </el-form>
    </div>
    <!--    body-->
    <div class="blogMain" style="margin-top: 15px">
      <div>
        <el-row>
          <el-button color="#1c84c6" size="mini" class="mainButton" @click="toCreateBlog">新增</el-button>
          <el-button color="#1ab394" size="mini" class="mainButton" @click="toUpdateBlog" :disabled="alterBlog">修改</el-button>
          <el-button color="#F7AB5A" size="mini" class="mainButton" @click="toUserBlog" :disabled="lookBlog">查看博客</el-button>
          <el-button color="#ed5565" size="mini" class="mainButton" @click="fnBlogDelete" :disabled="scDisabled">删除</el-button>
        </el-row>
        <el-table :data="blogData" size="mini" style="width: 100%;" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" />
          <el-table-column prop="bId" label="博客编号" width="180" />
          <el-table-column prop="bTitle" label="博客标题" />
          <el-table-column prop="user.uName" label="创建用户" />
<!--          <el-table-column prop="bSTitle" label="副标题" />-->
          <el-table-column prop="status" label="博文状态">
            <template #default="scope">
              {{ BLOG_STATUS[scope.row.status] ? BLOG_STATUS[scope.row.status] : '--' }}
            </template>
          </el-table-column>
          <el-table-column prop="bWatch" label="阅读人数" />
          <el-table-column prop="bLike" label="点赞次数" />
          <el-table-column prop="createTime" :formatter="timeForMat" label="发布时间" />
          <el-table-column prop="updateTime" :formatter="timeForMat" label="最后修改时间" />
        </el-table>
      </div>
    </div>
  </div>
</template>
<script lang="ts">
import './index.less'
import indexT from './indexT'

export default indexT
</script>
